import re

#电话号码
pattern="^(13\d|14[5|7]|15\d|166|17[3|6|7]|18\d)\d{8}$"
string="18844182513"
print(re.match(pattern, string, flags=0))

#字符串
pattern='<span class="title">(.*?)</span>(.*)'
string='<span class="title">这个杀手不太冷</span>aaa'
searchObj = re.search( pattern, string)
print( searchObj.group(1))
print( searchObj.group(2))

#18位身份证号
pattern="^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$"